var e = getApp(), t = require("../../../api.js");

Page({
    data: {
        beforeData: [],
        afterData: []
    },
    onLoad: function(a) {
        var n = a.order_no, r = this;
        e.request({
            url: t.order.getfind,
            method: "post",
            data: {
                order_no: n
            },
            success: function(e) {
                wx.hideLoading(), 1 == e.code && r.setData({
                    beforeData: e.data.before_pics.split(","),
                    afterData: e.data.after_pics.split(",")
                });
            }
        });
    },
    previewBefore: function(e) {
        var t = e.currentTarget.dataset.idx, a = this.data.beforeData;
        this.preview(t, a);
    },
    previewEnd: function(e) {
        var t = e.currentTarget.dataset.idx, a = this.data.afterData;
        this.preview(t, a);
    },
    preview: function(e, t) {
        wx.previewImage({
            current: t[e],
            urls: t
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});